<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
    ];

    /**
     * Define the application's command schedule.
     */
    protected function schedule(Schedule $schedule)
    {
        // Horizon指标计算
        $schedule->command('horizon:snapshot')->everyFiveMinutes();
        // 商品同步
        $schedule->command('product:sync')->everyMinute()->withoutOverlapping();
        // 订单取消
        $schedule->command('order:cancel')->everyMinute()->withoutOverlapping();
        // 订单分账
        $schedule->command('order:divide')->everyMinute()->withoutOverlapping();
        // 资产回收
        $schedule->command('asset:recovery')->everyMinute()->withoutOverlapping();
        // 空投异步
        $schedule->command('airdrop:sync')->everyMinute()->withoutOverlapping();
        // 同步assets表证书编号
        $schedule->command('asset:sync')->everyMinute()->withoutOverlapping();
        // 抽奖奖品发放
        $schedule->command('lottery:award-send')->everyMinute()->withoutOverlapping();
        // 检测用户处罚状态
        $schedule->command('user:punish')->everyMinute()->withoutOverlapping();
        // 盲盒自动打开
        $schedule->command('blindbox:auto-open')->everyMinute()->withoutOverlapping();
        // 发送站内信
        $schedule->command('message:send')->everyMinute()->withoutOverlapping();
        //计算转售基准价
        $schedule->command('resale:calc_avg_price')->at('00:01');
    }

    /**
     * Register the commands for the application.
     */
    protected function commands()
    {
        $this->load(__DIR__ . '/Commands');

        require base_path('routes/console.php');
    }
}
